<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/common/jsp/common.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>注册用户</title>
<script type="text/javascript">
    window.onload = function() {
        var username = document.getElementById("registerForm_user_CUsername");
        var password = document.getElementById("registerForm_user_CPassword");
        var rePassword = document.getElementById("rePassword");
        var realname = document.getElementById("registerForm_user_CRealname");
        var myRegister = document.getElementById("registerForm_myRegister");
        myRegister.onclick = function() {
            if (username.value.trim() == "") {
                alert("用户名不能为空！");
                return false;
            }
            if (password.value.trim() == "") {
                alert("密码不能为空！");
                return false;
            }
            if (rePassword.value.trim() == "") {
                alert("再次输入密码不能为空！");
                return false;
            }
            if (password.value.trim() != rePassword.value.trim()) {
                alert("两次密码输入不一致！");
                return false;
            }
            if (myRegister.value.trim() == "") {
                alert("姓名不能为空！");
                return false;
            }
        };
    };
</script>
</head>
<body>
    <s:form action="userActionImpl!register" id="registerForm"
        method="post">
        <s:textfield label="用户名" name="user.CUsername"></s:textfield>
        <s:password label="密码" name="user.CPassword"></s:password>
        <s:password label="重复密码" name="rePassword"></s:password>
        <s:textfield label="姓名" name="user.CRealname"></s:textfield>
        <s:submit value="注册" name="myRegister"></s:submit>
    </s:form>
</body>
</html>